<script setup>
import { ref } from 'vue'
import { Monitor, DataLine, UserFilled } from '@element-plus/icons-vue'

const systemInfo = ref({
  title: '医学细胞检测系统',
  version: 'v1.0.0'
})

const quickLinks = ref([
  {
    title: '检测中心',
    description: '开始新的细胞检测任务',
    path: '/ceter',
    icon: Monitor
  },
  {
    title: '检测结果',
    description: '查看历史检测结果',
    path: '/result',
    icon: DataLine
  },
  {
    title: '团队管理',
    description: '管理团队成员和权限',
    path: '/team',
    icon: UserFilled
  }
])
</script>

<template>
  <div class="index-container">
    <div class="welcome-section">
      <h1>{{ systemInfo.title }}</h1>
      <p class="version">{{ systemInfo.version }}</p>
    </div>

    <div class="quick-links">
      <el-row :gutter="36">
        <el-col
          :xs="24"
          :sm="12"
          :md="8"
          v-for="link in quickLinks"
          :key="link.title"
        >
          <el-card class="link-card" shadow="hover">
            <router-link :to="link.path">
              <div class="card-content">
                <el-icon class="link-icon"
                  ><component :is="link.icon"
                /></el-icon>
                <h3>{{ link.title }}</h3>
                <p>{{ link.description }}</p>
              </div>
            </router-link>
          </el-card>
        </el-col>
      </el-row>
    </div>

    <div class="system-status">
      <el-card shadow="hover">
        <template #header>
          <div class="card-header">
            <span>系统状态</span>
          </div>
        </template>
        <div class="status-content">
          <p>系统运行正常</p>
          <el-progress :percentage="100" status="success" />
        </div>
      </el-card>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.index-container {
  padding: 40px;
  background: #f5f7fa;
  min-height: calc(100vh - 60px);
}

.welcome-section {
  text-align: center;
  margin-bottom: 60px;

  h1 {
    font-size: 38px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .version {
    color: #666;
    font-size: 16px;
  }
}

.quick-links {
  margin-bottom: 60px;

  .link-card {
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.4s;
    margin-bottom: 36px;

    &:hover {
      transform: translateY(-8px);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    }
  }

  .card-content {
    text-align: center;
    padding: 42px 24px;

    .link-icon {
      font-size: 56px;
      color: #667eea;
      margin-bottom: 28px;
    }

    h3 {
      font-size: 22px;
      font-weight: 600;
      color: #333;
      margin-bottom: 18px;
    }

    p {
      color: #666;
      font-size: 16px;
      line-height: 1.6;
    }
  }
}

.system-status {
  max-width: 800px;
  margin: 0 auto;

  .el-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    padding: 0;

    &:hover {
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    }
  }

  .card-header {
    font-weight: 600;
    font-size: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
  }

  .status-content {
    padding: 32px;

    p {
      margin-bottom: 24px;
      color: #67c23a;
      font-weight: 500;
      font-size: 18px;
    }

    :deep(.el-progress) {
      margin-top: 24px;
      height: 12px;
    }

    :deep(.el-progress-bar__inner) {
      transition: all 0.5s;
    }

    :deep(.el-progress-bar__outer) {
      border-radius: 6px;
      height: 12px !important;
    }

    :deep(.el-progress-bar__inner) {
      border-radius: 6px;
    }
  }
}

a {
  text-decoration: none;
  color: inherit;
}
</style>
